<template>
<div>
  <div class="weui-cells__title">身份信息</div>
  <div class="weui-cells">
    <div class="weui-cell">
      <div class="weui-cell__bd">
        <p>姓名</p>
      </div>
      <div class="weui-cell__ft">{{userInfo.realName}}</div>
    </div>
    <div class="weui-cell">
      <div class="weui-cell__bd">
        <p>身份证号</p>
      </div>
      <div class="weui-cell__ft">{{userInfo.cardNo}}</div>
    </div>
    <div class="weui-cell card-img">
        <div>
          <img :src="resUrl+userInfo.frontImgUrl" alt="">
        </div>
        <div>
          <img :src="resUrl+userInfo.reverseImgUrl" alt="">
        </div>
        <div>
          <img :src="resUrl+userInfo.userHoldenImgUrl" alt="">
        </div>
    </div>
  </div>
  <div class="btn-box">
    <button class="weui-btn weui-btn_warn" @click="goBack">确认</button>
  </div>
</div>
</template>

<script>
  import {ipconfig} from "../../../assets/js/ipconfig";
  import {getUserIdCardMsg} from '../../../assets/js/getData';
  export default {
    name: "idcardInfo",
    data(){
      return {
        resUrl:ipconfig.resUrl,//图片、视频、音频等资源访问路径
        userInfo:{},
      }
    },
    created(){
      //获取用户实名认证信息
      getUserIdCardMsg().then(res => {
        if(res.data.reqResult.code>0){
          this.userInfo = res.data.data;
        }else {
          Toast(res.data.reqResult.msg);
        }
      })
    },
    methods:{
      goBack(){
        this.$router.go(-1)
      }
    }
  }
</script>

<style scoped>
  .weui-cell__bd{
    width: 5rem;
    flex: none;
  }
  .card-img{
    display: flex;
    justify-content: space-between;
    padding-top: 0.8rem;
  }
  .card-img div{
    width: 29.6vw;
  }
  .card-img img{
    width: 100%;
  }
  .weui-cells:after{
    border-bottom: none;
  }
  .btn-box{
    position: absolute;
    bottom: 1.5rem;
    left: 0;
    right: 0;
  }
</style>
